//package com.li.configure;
//
//import com.li.filter.RocketMqSendMessageHook;
//import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer;
//import org.apache.rocketmq.client.producer.DefaultMQProducer;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.stereotype.Component;
//
///**
// * @program: rocketmq_boot
// * @description:
// * @author: li
// * @create: 2023-03-08 10:41
// **/
////@Configuration
//public class MqConfigCopy {
//
//
//    @Bean
//    public DefaultMQProducer defaultMQProducer(@Value("${rocketmq.name-server}") String namesrvAddr,
//                                               @Value("${rocketmq.producer.group}") String producerGroup,
//                                               @Value("${rocketmq.producer.send-message-timeout}") int sendMsgTimeout,
//                                               @Value("${rocketmq.producer.retry-times-when-send-failed}") int retryTimesWhenSendFailed,
//                                               @Value("${rocketmq.producer.retry-times-when-send-async-failed}") int retryTimesWhenSendAsyncFailed) {
//        DefaultMQProducer producer = new DefaultMQProducer();
//        producer.setNamesrvAddr(namesrvAddr);
//        producer.setSendMsgTimeout(60000);
//        producer.setProducerGroup(producerGroup);
//        producer.setSendMsgTimeout(sendMsgTimeout);
//        producer.setRetryTimesWhenSendFailed(retryTimesWhenSendFailed);
//        producer.setRetryTimesWhenSendAsyncFailed(retryTimesWhenSendAsyncFailed);
//        // 设置
//        producer.getDefaultMQProducerImpl().registerSendMessageHook(new RocketMqSendMessageHook());
//        return producer;
//    }
//
//}
